//
//  IGLoginApi.h
//  jingdongfang
//
//  Created by BOE on 2017/8/9.
//  Copyright © 2017年 ZhiYu Hao. All rights reserved.
//

#import <YTKNetwork/YTKNetwork.h>
#import "IGBaseResp.h"
#import "IGUserInfo.h"
#import "IGBaseRequest.h"

/** 登录方式 */
typedef NS_ENUM(NSInteger, IGLoginType) {
    IGLoginTypeWChat = 0,                  ///>第三方登录之微信
    IGLoginTypeQQ = 1,                     ///>第三方登录之QQ
    IGLoginTypeWeiBo = 2,                  ///>第三方登录之微博
    IGLoginTypeNormal = 3                  ///>正常登录
};

/** 登录平台 */
typedef NS_ENUM(NSInteger, IGTloginPlatType) {
    IGTloginPlatTypewx = 0,                     ///>第三方登录之微信
    IGTloginPlatTypeqq = 1,                     ///>第三方登录之QQ
    IGTloginPlatTypeweibo = 2                   ///>第三方登录之微博
};

/** 应用类型：这里是app */
typedef NS_ENUM(NSInteger, IGTClientType) {
    IGTClientTypeweb = 0,                     ///>第三方登录web
    IGTClientTypewap = 1,                     ///>第三方登录wap
    IGTClientTypeapp = 2                     ///>第三方登录app
};
@interface IGLoginApi : IGBaseRequest

@property (nonatomic, assign) IGLoginType loginType;
@property (nonatomic, assign) IGTloginPlatType loginPlat;       //登录平台代码
@property (nonatomic, assign) IGTClientType clientType;         //客户端类型代码

- (id)initWithLoginType:(IGLoginType)loginType;

#pragma mark -IGTLoginTypeNormal
@property (nonatomic, copy) NSString *username;
@property (nonatomic, copy) NSString *password;

#pragma mark -IGTLoginTypeWChat/IGTLoginTypeWeiBo/IGTLoginTypeQQ
@property (nonatomic, copy) NSString *openId;               //登录平台代码
@property (nonatomic, copy) NSString *accessToken;          //客户端类型代码
@property (nonatomic, copy) NSString *nike;                 //用户授权后返回的code
@property (nonatomic, copy) NSString *image;                //授权url中包含此参数、回调时传回

@end

@interface IGLoginModel : IGBaseModel

@property (nonatomic, copy) IGUserInfo *userinfo;
@property (nonatomic, assign) BOOL isFirst;

@end

@interface IGLoginResp : IGBaseResp

@property (nonatomic, copy) IGLoginModel *data;

@end
